
#include <iostream>
#include "Single.h"

using namespace npSingleton;
using namespace std;


void doSingleton()
{
    weak_ptr<Single> one = Single::getInst();
    weak_ptr<Single> two = Single::getInst();

    if (shared_ptr<Single> _one = one.lock())
    {
        if (shared_ptr<Single> _two = two.lock())
        {
            cout << "we're the same? (one, two): " << (_one.get() == _two.get() ? "Yes" : "No") << endl;

            cout << "one says " << _one->say() << endl;
            cout << "two says " << _two->say("xixi") << endl;
        }
    }
}
